<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ page import="com.yaodian100.core.common.utils.ServerValue"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c-rt"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<c-rt:set var="frontContextPath" value='<%=ServerValue.getFrontContextPath()%>'/>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript" charset="UTF-8" src="/js/jquery.timers-1.2.js"></script>
<Style>
li.w-1of1{overflow:hidden}
</style>
<script language="javascript">
	$().ready(function(){

		$("#current_location").html('&nbsp;&gt;&nbsp;<a href="${frontContextPath}/member/modifydata.do">个人信息管理&nbsp;-&nbsp;修改个人信息</a>&nbsp;&gt;&nbsp;删除手机号码');
		$("#m_modifyData").css("font-weight","bold");

		$("#sdialog").dialog({
			autoOpen: false,
			bgiframe: true,
			height: 150,
			width:325,
			modal: true
		});

		if("${actionResult}" == "resend_success"){
			$("#sdialog").dialog('open');
		}else if("${actionResult}" == "ccode_error"){
			$("#ccodeTip").text('校验码无效');
			$("#ccodeTip").show();
		}

		var left = 300;
		if(parseInt('${member.mobileModifyCount}')<10){
			if("${actionResult}" == "resend_success" || "${actionResult}" == "delete_send_success"){
				$('body').everyTime('1s',function(){
					if(left==0){
						$('body').stopTime ();
						$('#resend').removeAttr('disabled');
						$('#resend').val('点此重发校验码');
						return;
					}
					$('#resend').val('请于'+left+'秒后点此重发校验码');
					left--;
				});
			}else{
				left=0;
				$('#resend').removeAttr('disabled');
				$('#resend').val('点此重发校验码');
			}
		}else{
			$('#resend').val('点此重发校验码');
		}
				
		$('#resend').click(function(){
			//重发
			window.location.replace("${frontContextPath}/member/godeletemobile.do");
		});

		$("#sclose").click(function(){
			$("#sdialog").dialog('close');
		});

		$("#goactivate").click(function(){
			$("#ccodeTip").hide();
			if($("#ccode").val().length==0){
				$("#ccodeTip").text('请输入校验码');
				$("#ccodeTip").show();
				return;
			}else if($("#ccode").val().length!=8){
				$("#ccodeTip").text('校验码错误');
				$("#ccodeTip").show();
				return;
			}
			$("#toMobileActivateForm").submit();
			return false;
		});
	});
</script>
</head>
<body>
<div id="sdialog" title="成功发送手机短信" class="member-reg-alert-ok" style="display:none;">
  <p id="smsg">已经向您的手机<span class="txt-rd"><strong>${member.mobile}</strong></span><br />
  发送免费的验证短信。</p>
  <div align="center"> <span style="text-align:center;"><a href="javascript:;" class="btn-mid" id="sclose">关闭</a></span> </div>
</div>
<h2><span class="location">删除手机号码</span></h2>
    <!-- 內容 -->
    <div class="change-email">
        <p class="c-f LH-1of5">&nbsp;</p>
        <p class="txt-L">&nbsp;</p>
        <p class="txt-m" style="margin-left:100px;">校验码短信已发送到您的手机，请输入校验码：</p>
        <s:form action="deleteMobileActivate.do" method="post" id="toMobileActivateForm">
        <div class="d-show">
  		  <ul style="margin-left:150px;">
              <li class="w-1of1"><div><strong>校验码：</strong></div><div><input type="text" id="ccode" name="ccode" maxlength="8"/><span style="display:block"><span class="msg rn" style="display:none" id="ccodeTip">校验码无效</span></span></div></li>
          </ul>
      	</div>
        <p align="center"><a href="javascript:;" class="btn-mid" id="goactivate">确定</a></p>
        </s:form>
        <p align="center">&nbsp;</p>
        <p align="center">如果您<c:if test="${actionResult == 'resend_success' || actionResult == 'delete_send_success'}">在5分钟内</c:if>没有收到校验码，<input type="submit" name="button" id="resend" value="请于300秒后点此重发校验码" class="btn-reg-phone"  disabled="disabled"/><c:if test="${member.mobileModifyCount >= 10}">(已达使用次数上限)</c:if></p>
        <p>&nbsp;</p>
        <p align="center">&nbsp;</p>  
    </div>
    <!-- 內容 -->
    <!-- 注意事项 -->

    <div class="txt-note">
     <p><strong>【提示】</Strong></p>
      <ul>
        <li>．校验码短信已发送，请查阅您的手机短信。</li>
        <li>．耀点100给您发送的手机校验码短信是免费的。</li>
        <li>．每个帐户进行手机验证，一个月内使用短信最多10次。</li>
      </ul>
    </div>
    <!-- 注意事项 -->
</body>
</html>